
import JsEncrypt from './jsencrypt';

// 加密
let pkey = '-----BEGIN PUBLIC KEY-----\n' +
  'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9YoMMfB6Qe+mWtmEWYzEmM1oH\n' +
  '8irD5tXxRXBCZsBUSXMNSdyl8fnDGkfvKGY2qHefPRPCT1ScqfvIZDVtecaGA0J+\n' +
  'ckYs6/s39tVCR13Vli8lmt/ji8E3oTJWv2h0JoFZ46y1Q/4TEEwO05zpJN4sUri5\n' +
  'IwCAWoZ94W3wASnVgQIDAQAB\n' +
  '-----END PUBLIC KEY-----';
let $jsEncrypt = new JsEncrypt();
$jsEncrypt.setPublicKey(pkey);

window.Vue.prototype.$jsEncrypt = (word) => {
    return $jsEncrypt.encryptByPublic(word);
};
